﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using Zor_Modes;
using Zor_Tools;
using Zor_Bll;
using Newtonsoft.Json.Linq;
using System.IO;

namespace Zor_API.Controllers
{
    public class WeatherController : ApiController
    {
        [HttpPost]
        public HttpResponseMessage WeatherInfo()
        {
            BaseAnswer bar = new BaseAnswer();
            string strUrl = "";
            WebRequest request = WebRequest.Create(strUrl);
            WebResponse response = request.GetResponse();
            Stream stream = response.GetResponseStream();
            StreamReader streamReader = new StreamReader(stream);
            string str = streamReader.ReadToEnd();

            HttpResponseMessage result = new HttpResponseMessage
            {
                Content = new StringContent(bar.ToJson(), System.Text.Encoding.GetEncoding("UTF-8"), "application/json")
            };
            return result;
        }
    }
}
